from typing import List

from pydantic import BaseModel, Field

"""
Belong--接收前端的类
Description--[隐私条款，用户中心，帮助中心]
"""

"""
隐私条款
"""


class ComplianceAndAgreementsDto(BaseModel):
    type: int = Field(..., description="条款类型 [(1, 'terms_and_condition'), (2, 'cookie_policy',), (3, 'legal_notice'), (4, 'prohibited_goods')]")


"""
Q&A问答
"""


class QuestionAndAnswerLevelOneFilterDto(BaseModel):
    name: str = Field(None, description='名称')
    key_word: List[int] = Field(None, description='关键字ID')


"""
用户中心
"""


class OrderFilter(BaseModel):
    """
    订单过滤
    """
    user_id: int = Field(..., description='用户ID')
    order_state: int = Field(None, description='订单状态 1 待支付 2 已支付 不传为全部')
    page: int = Field(..., description='页数')
    page_size: int = Field(10, description='每页个数')
    order_by: str = Field('create_date ASC', description='排序')


class AddressDto(BaseModel):
    """
    地址信息
    """
    id: int = Field(None, description='ID')
    rel_type: str = Field(..., description='关联类型 地址-address 联系人-contact')
    default_address: bool = Field(..., description='默认地址')
    address_type: str = Field(..., description='地址类型')
    contact_company_name: str = Field(None, description='公司名称 地址类型为个人此处可以为空')
    last_name: str = Field(..., description='名')
    first_name: str = Field(..., description='姓')
    mobile: str = Field(..., description='手机')
    area_code: str = Field(..., description='区号')
    street: str = Field(..., description='街道1')
    street2: str = Field(..., description='街道2')
    email: str = Field(..., description='邮箱')
    postal_code: int = Field(..., description='邮编')
    edit_tag: bool = Field(..., description='编辑/保存 编辑-True 保存-False')


class UserInfoDto(BaseModel):
    """
    用户信息
    """
    id: int = Field(..., description='用户ID')
    first_name: str = Field(..., description='名')
    last_name: str = Field(..., description='姓')
    area_code: str = Field(..., description='区域码')
    phone: str = Field(..., description='手机号')


class UserSecurityDto(BaseModel):
    """
    用户安全信息
    """
    user_id: int = Field(..., description='用户ID')
    user_name: str = Field(..., description='用户名')
    old_password: str = Field(..., description='旧密码')
    new_password: str = Field(..., description='新密码')


class CustomerCouponFilterDto(BaseModel):
    """
    优惠券过滤选项
    """
    user_id: int = Field(..., description='用户ID')
    coupon_type: str = Field(None, description='优惠券类型')
    coupon_state: str = Field(None, description='优惠券状态')
    order_by: List[str] = Field(['create_date ASC'], description='排序')
    tag: bool = Field(..., description='标志【0 为展示全部 1 为添加了过滤项】')
    page: int = Field(..., description='页码')
    page_size: int = Field(..., description='页大小')


class PopUpDto(BaseModel):
    """
    充值参数
    """
    user_id: int = Field(..., description='用户ID')
    amount: int = Field(..., description='充值金额')
    pay_type: int = Field(..., description='充值方式【1 Stripe支付 2 银行卡支付 3 支付宝支付】')
